<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="/WEB-INF/c.tld" %>
<%@ taglib prefix="fmt" uri="/WEB-INF/fmt.tld" %>
<c:if test="${orderList==null}">
	<c:redirect url="/User/OrderServlet?act=orderList&fromPage=/User/Show_Orderlist.jsp&curPage=1"></c:redirect>
</c:if>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta http-equiv="pragma" content="no-cache" />
	<meta http-equiv="Cache-Control" content="no-cache, must-revalidate" />
	<meta http-equiv="expires" content="Wed, 26 Feb 1970 08:21:57 GMT" />
	<link href="<c:url value='/images/css/style.css' />" rel="stylesheet" type="text/css" />
	<title>订单列表</title>
	<script language="javascript" src="<c:url value='/js/calendar.js' />"></script>
    <script language="javascript">
    
		function pagingOnClick(num){
			if(num==1){
				orderList.curPage.value=1;
			}
			if(num==2){
				orderList.curPage.value=${curPage} - 1;
			}
			if(num==3){
				orderList.curPage.value=${curPage} + 1;
			}
			if(num==4){
				orderList.curPage.value=${pageCount};
			}
			orderList.submit();
		}
	</script>
</head>
<body>
<div id="container">
  <div id="globalHeader">
  <p id="logo"><a href="#"><img src="<c:url value='/images/logo.gif' />" alt="logo" /></a></p>
  <ul id="globalTopNav">
      <li><a href="<c:url value='/User_Reg.jsp' />" >用户注册</a></li>
      <li><a href="<c:url value='/User_Login.jsp' />" >用户登陆</a></li>
      <li><a href="<c:url value='/User/Change_Info.jsp' />" >会员中心</a></li>
      <li><a href="<c:url value='/Cart.jsp' />" >购物车</a></li>
      <li><a href="<c:url value='/User/Show_Orderlist.jsp' />" >查看订单</a></li>
      <li id="globalTopNavLast"><a href="<c:url value='/Admin_Login.jsp' />" >后台管理</a></li>
      <li id="globalTopNavRight">&nbsp;</li>
  </ul>
</div>
<div id="globalNav">
  <ul>
    <li><a href="<c:url value='/Show.jsp' />">首页</a></li>
    <li><a href="<c:url value='/User/Change_Info.jsp' />" >会员中心</a></li>
    <li id="currentPage"><a href="<c:url value='/User/Show_Orderlist.jsp' />" >查看订单</a></li>
  </ul>
</div>
<div id="urHere" class="globalModule globalFrame" style="margin-top:10px">
    <h3>当前位置: <a href="<c:url value='/Show.jsp' />">首页</a> <code>&gt;</code> 订单列表</h3>
</div>
<div id="globalLeft">
<div class="globalModule">
  <h3>订单列表</h3>
  <ul class="listStyle">
    <li><a href="<c:url value='/User/Change_Info.jsp' />">用户信息</a></li>
    <li><a href="<c:url value='/User/Change_Pass.jsp' />">修改密码</a></li>
    <li><a href="<c:url value='/Cart.jsp' />">查看购物车</a></li>
    <li><a href="<c:url value='/User/Show_Orderlist.jsp' />">我的订单</a></li>
    <li><a href="<c:url value='/servlet/LogoutServlet?act=user' />">退出</a></li>
  </ul>
</div>
</div>
<div id="globalBigRight">
	<div class="globalModule">
        <h3>订单列表页</h3>
        <div class="globalModuleContent">
        <form action="<c:url value='/User/OrderServlet' />" name="orderList" method="get" >
        <input type="hidden" name="curPage" value="1" />
        <input type="hidden" name="fromPage" value="Show_Orderlist.jsp" />
        <input type="hidden" name="act" value="orderList" />
        
		
        <table cellpadding="0" cellspacing="0" class="tableList">
          <tr>
            <th>订单编号</th>
            <th>下单日期</th>
            <th>商品数量</th>
            <th>总价</th>
            <th>审核情况</th>
            <th>操作</th>
          </tr>
<c:forEach var="orderBean" items="${orderList}">
          <tr>
            <td><span onClick="javascript:location.href='OrderServlet?act=orderItem&fromPage=/User/Show_Orderitem.jsp&orderId=' + ${orderBean.nid} " style="cursor:hand;" title="点击查看订单明细信息">${orderBean.nid}&nbsp;</span></td>
            <td>${orderBean.dgdate}&nbsp;</td>
            <td>${orderBean.nmcsize}&nbsp;</td>
            <td>${orderBean.ntotalprice}&nbsp;</td>
            <td>${orderBean.sstatus}&nbsp;</td>
            <td><span onClick="javascript:location.href='OrderServlet?act=orderItem&fromPage=/User/Show_Orderitem.jsp&orderId=' + ${orderBean.nid} " style="cursor:hand;" title="点击查看订单明细信息">订单明细</span>&nbsp;</td>
          </tr>
</c:forEach>
        </table>
			<div id="pager">
				总计 ${recordSize} 条记录，共 ${pageCount} 页，当前第 ${curPage} 页
				<c:choose>
				<c:when test="${curPage==1}">
				<span>首页</span>
				<span>上一页</span>
				</c:when>
				<c:otherwise>
				<a href="#" onClick="pagingOnClick(1);return false;" >首页</a>
				<a href="#" onClick="pagingOnClick(2);return false;" >上一页</a>
				</c:otherwise>
				</c:choose>
				<c:choose>
				<c:when test="${curPage==pageCount}">
				<span>下一页</span>
				<span>尾页</span>
				</c:when>
				<c:otherwise>
				<a href="#" onClick="pagingOnClick(3);return false;" >下一页</a>
				<a href="#" onClick="pagingOnClick(4);return false;" >尾 页</a>
				</c:otherwise>
				</c:choose>
			</div>
        </form>
		</div>
	</div>
</div>
<div id="globalFooter">
<div id="footerLine"><img src="<c:url value='/images/footer_line.gif' />" alt="" /></div>
    <p id="footerNav">
      <a href="#" >免责条款</a> 
        |
      <a href="#" >隐私保护</a> 
        |
      <a href="#" >咨询热点</a> 
        |
      <a href="#" >联系我们</a> 
        |
      <a href="#" >公司简介</a> 
        |
      <a href="#" >预留功能</a> 
        |
      <a href="<c:url value='/Admin_Login.jsp' />" >后台管理</a> 
    </p>
</div></div>
</body>
</html>